package model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Id;

import com.google.appengine.api.datastore.Text;
import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Cached
public class Articles implements Serializable{
	public String utilDate(){
		SimpleDateFormat dt = new SimpleDateFormat("MM-dd-yyyy"); 
		return dt.format(new Date());
	}
	@Id private String alias = "";
	@Unindexed private Text title = null;
	@Unindexed private Text content = null;
	@Indexed private String authorAlias = "";
	@Unindexed private String author = "";
	@Indexed private long date = new Date().getTime();
	@Indexed private String strdate = utilDate();
	public String getStrdate() {
		return strdate;
	}
	public void setStrdate(String strdate) {
		this.strdate = strdate;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public Text getTitle() {
		return title;
	}
	public void setTitle(Text title) {
		this.title = title;
	}
	public Text getContent() {
		return content;
	}
	public void setContent(Text content) {
		this.content = content;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getAuthorAlias() {
		return authorAlias;
	}
	public void setAuthorAlias(String authorAlias) {
		this.authorAlias = authorAlias;
	}
	public long getDate() {
		return date;
	}
	public void setDate(long date) {
		this.date = date;
	}
}
